import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Blogs from '../views/Blogs.vue'
import Article from '../views/Article.vue'
import Search from '../views/Search.vue'
import Community from '../views/Community.vue'
import User from '../views/User.vue'
import UserInfo from '../views/UserInfo.vue'
import Login from '../views/Login.vue'
import UserOthers from '../views/UserOthers.vue'
import SearchAll from '../components/SearchAll.vue'
import SearchArticle from '../components/SearchArticle.vue'
import SearchTopic from '../components/SearchTopic.vue'
import SearchUser from '../components/SearchUser.vue'
import BlogsContentArticle from '../components/BlogsContentArticle.vue'
import BlogsTotal from '../components/BlogsTotal.vue'
import BlogsFront from '../components/BlogsFront.vue'
import BlogsBack from '../components/BlogsBack.vue'
import BlogsAndroid from '../components/BlogsAndroid.vue'
import BlogsIos from '../components/BlogsIos.vue'
import BlogsArtificial from '../components/BlogsArtificial.vue'
import BlogsLife from '../components/BlogsLife.vue'
import UserMlDynamic from '../components/UserMlDynamic.vue'
import UserMlAnswer from '../components/UserMlAnswer.vue'
import UserMlText from '../components/UserMlText.vue'
import UserMlCollect from '../components/UserMlCollect.vue'
import UserMlFollow from '../components/UserMlFollow.vue'
import UserMlFol1 from '../components/UserMlFol1.vue'
import UserMlFol2 from '../components/UserMlFol2.vue'
import UserOthDynamic from '../components/UserOthDynamic.vue'
import UserOthAnswer from '../components/UserOthAnswer.vue'
import UserOthText from '../components/UserOthText.vue'
import UserOthCollect from '../components/UserOthCollect.vue'
import UserOthFollow from '../components/UserOthFollow.vue'
import UserOthFol1 from '../components/UserOthFol1.vue'
import UserOthFol2 from '../components/UserOthFol2.vue'

import Index from '../views/index/Index.vue'
import BookShop from '../views/bookshop/BookShop.vue'
import Details from '../views/index/Details.vue'
import Content from '../views/index/Content.vue'
import Write from '../views/index/Write.vue'
import BookContent from '../views/bookshop/BookContent.vue'
import MainShow from '../views/bookshop/MainShow.vue'
import Buy from '../views/bookshop/Buy.vue'
import StateRange from '../views/bookshop/StateRange.vue'

import Talk from '../views/Talk.vue'
import ArticleText from '../components/talk/ArticleText.vue'
import ArticleText1 from '../components/talk/ArticleText1.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/Blogs',
    name: 'Blogs',
    component:Blogs,
    children:[
        {path:'',component:BlogsTotal,
          children:[
            {path:'',component:BlogsContentArticle}
          ]},
        {path:'total',component:BlogsTotal,name:'Total',
          children:[
            {path:'',component:BlogsContentArticle}
          ]},
        {path:'front',component:BlogsFront,name:'front',
          children:[
            {path:'',component:BlogsContentArticle}
          ]},
        {path:'back',component:BlogsBack,name:'Front',
          children:[
            {path:'',component:BlogsContentArticle}
          ]},
        {path:'android',component:BlogsAndroid,name:'Android',
          children:[
            {path:'',component:BlogsContentArticle}
          ]},
        {path:'ios',component:BlogsIos,name:'Ios',
          children:[
            {path:'',component:BlogsContentArticle}
          ]},
        {path:'artificial',component:BlogsArtificial,name:'Artificial',
          children:[
            {path:'',component:BlogsContentArticle}
          ]},
        {path:'life',component:BlogsLife,name:'Life',
          children:[
            {path:'',component:BlogsContentArticle}
          ]},
    ]
  },
  {
    path:'/home',
    name: 'Home',
    component: Home
  },
  {
    path:'/article',
    name: 'article',
    component: Article
  },
  // {
  //   path:'/search',
  //   name: 'searchs',
  //   component: Search,
  //   children:[
  //     {path:'',component:SearchAll}]
  // },
  {
    path:'/search',
    name: 'searchs',
    component: Search,
    children:[
        {path:'',component:SearchAll},
        {path:'all',component:SearchAll},
        {path:'a',component:SearchArticle},
        {path:'t',component:SearchTopic},
        {path:'u',component:SearchUser}
    ]
  },
  {
    path:'/community',
    name: 'community',
    component: Community
  },
  {
    path: '/user',
    redirect:'/UserMlDynamic'
  },
  {
    path: '/UserMlDynamic',
    name: 'User',
    component: User,
    children: [
      { path: '/UserMlDynamic', component: UserMlDynamic, name: 'UserMlDynamic' },
      { path: '/UserMlAnswer', component: UserMlAnswer, name: 'UserMlAnswer' },
      { path: '/UserMlText', component: UserMlText, name: 'UserMlText' },
      { path: '/UserMlCollect', component: UserMlCollect, name: 'UserMlCollect' },
      { path: '/UserMlFollow', 
        component: UserMlFollow, 
        name: 'UserMlFollow' ,
        redirect:'/UserMlFollow/UserMlFol1'},
      {
        path: '/UserMlFollow/UserMlFol1', 
        component: UserMlFollow, 
        name: 'UserMlFollow',
        children: [
          { path: '/UserMlFollow/UserMlFol1', component: UserMlFol1, name: 'UserMlFol1' },
          { path: '/UserMlFollow/UserMlFol2', component: UserMlFol2, name: 'UserMlFol2' }
        ]
      },
    ]
  },
  
  {
    path: '/userInfo',
    name: 'UserInfo',
    component: UserInfo
  },
  {
    path: '/userOthers',
    redirect:'/UserOthDynamic'
  },
  {
    path: '/UserOthDynamic',
    name: 'UserOthers',
    component: UserOthers,
    children: [
      { path: '/UserOthDynamic', component: UserOthDynamic, name: 'UserOthDynamic' },
      { path: '/UserOthAnswer', component: UserOthAnswer, name: 'UserOthAnswer' },
      { path: '/UserOthText', component: UserOthText, name: 'UserOthText' },
      { path: '/UserOthCollect', component: UserOthCollect, name: 'UserOthCollect' },
      { path: '/UserOthFollow', 
        component: UserOthFollow, 
        name: 'UserOthFollow' ,
        redirect:'/UserOthFollow/UserOthFol1'},
      {
        path: '/UserOthFollow/UserOthFol1', 
        component: UserOthFollow, 
        name: 'UserOthFollow',
        children: [
          { path: '/UserOthFollow/UserOthFol1', component: UserOthFol1, name: 'UserOthFol1' },
          { path: '/UserOthFollow/UserOthFol2', component: UserOthFol2, name: 'UserOthFol2' }
        ]
      },
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },

  {
    path:'/index',
    name:'Index',
    component:Index,
    children:[
      {
        path:'content',
        name:'content',
        component:Content
      },
      {
        path:'details',
        name:'Details',
        component:Details
      },
      {
        path:'write',
        name:'Write',
        component:Write
      }
    ]
  },
  {
    path:'/mainshow',
    name:'mainshow',
    component:MainShow,
    children:[
      {
    path:'bookshop',
    name:'BookShop',
    component:BookShop
      },
      {
        path:'bookcontent',
        name:'bookcontent',
        component:BookContent
      },
      {
        path:'buy',
        name:'buy',
        component:Buy
      },
      {
        path:'staterange',
        name:'StateRange',
        component:StateRange
      }
    ]
  },

  
  {
    path:'/talk',
    name: 'Talk',
    component: Talk,
    children:[
      {path:'',component:ArticleText},
      {path:'/ArticleText',component:ArticleText},
      {path:'/ArticleText1',component:ArticleText1},
    ]
    
  },
]

const router = new VueRouter({
  mode: 'history',
  linkActiveClass:'myactive',
  base: process.env.BASE_URL,
  routes
})

export default router
